# Types.rb
#

module KDTree

  #
  # Point
  #
  class Point
    
    def initialize (x = 0, y = 0)
      @x, @y = x, y
    end
    
    def x= (x)
      @x = x
    end
    
    def x
      @x
    end
    
    def y= (y)
      @y = y
    end
    
    def y
      @y
    end
    
  end
  
  #
  # Rect
  #
  class Rect
    
    def initialize (topLeft = Point.new, bottomRight = Point.new)
      @topLeft = topLeft
      @bottomRight = bottomRight
    end
    
    def topLeft= (topLeft)
      @topLeft = topLeft
    end
    
    def topLeft
      @topLeft
    end
    
    def bottomRight= (bottomRight)
      @bottomRight = bottomRight
    end
    
    def bottomRight
      @bottomRight
    end
    
  end

end

#
# Test code
#
if __FILE__ == $0
  pt = KDTree::Point.new 23, 32
  pt.x = 100
  pt.y = 200.15
  print pt.x, " ", pt.y, "\n"
  print pt.y / pt.x, "\n"
end
